﻿{extend name="public:base" /}

{block name="css"}
<link href="__ADMIN__/css/style.css" rel="stylesheet">
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post" class="layui-form fairy-form">
                        <div class="box-item">
                            <div class="box-item">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">首单最小金额</label>
                                    <div class="col-sm-3">
                                        <input type="number" class="form-control" name="first_order_min_price" placeholder="请输入首单最小金额" value="{$first_order_min_price}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                            </div>
                            <div class="box-item">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">金额不足提示语</label>
                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" name="less_min_price_msg" placeholder="请输入金额不足提示语" value="{$less_min_price_msg}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                            </div>
                        </div>

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-primary" onclick="save()">
                                    保存
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}

{block name='js'}
<script>
    // 保存
    function save() {
        var formData = $('form').serialize();
        $.post("{:url('setFirstOrderRule')}", formData, function (res){
            layer.msg(res.msg);
            setTimeout(function (){
                window.location.reload();
            },1000)
        }, 'JSON')
    }

</script>
{/block}
